<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateApprovalLogTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('approval_log', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('list_id')->default(0)->comment('申请列表id');
            $table->integer('apply_user_id')->default(0)->comment('审批用户id');
            $table->integer('step')->default(0)->comment('步骤:1自增');
            $table->integer('apply_result')->default(0)->comment('0未审批1通过2拒绝');
            $table->string('approval_reason')->nullable()->comment('审批理由');
            $table->timestamp('approval_time')->nullable()->comment('审批时间');
            $table->timestamps();
            $table->softDeletes();
        });
        \Illuminate\Support\Facades\DB::statement("ALTER TABLE `approval_log` comment '审批列表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('approval_log');
    }
}
